<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>Compute Library: arm_compute::test::convolution_3d::detail Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Compute Library
   &#160;<span id="projectnumber">18.05</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
      <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.xhtml"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="namespaces.xhtml"><span>Namespace&#160;List</span></a></li>
      <li><a href="namespacemembers.xhtml"><span>Namespace&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">arm_compute::test::convolution_3d::detail Namespace Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a03098570a566d97570169cb6d3106b6e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a03098570a566d97570169cb6d3106b6e">is_valid_pixel</a> (int i, int min, int max)</td></tr>
<tr class="separator:a03098570a566d97570169cb6d3106b6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74dc80546816db5f19029d6819a8bfee"><td class="memTemplParams" colspan="2">template&lt;typename T , typename TB , typename std::enable_if&lt; validation::is_floating_point&lt; T &gt;::value &amp;&amp;validation::is_floating_point&lt; TB &gt;::value, int &gt;::type  = 0&gt; </td></tr>
<tr class="memitem:a74dc80546816db5f19029d6819a8bfee"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a74dc80546816db5f19029d6819a8bfee">convolution3d</a> (const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; T &gt; &amp;in, const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; T &gt; &amp;weights, const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; TB &gt; &amp;bias, <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; T &gt; &amp;out, int i_offset, int w_offset, int b_offset, int o_offset, int xi, int yi, int width_in, int height_in, int depth_in, int width_weights, int height_weights, int dilation_x=1, int dilation_y=1)</td></tr>
<tr class="separator:a74dc80546816db5f19029d6819a8bfee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0be4a57124877f215e0d37de9e538e81"><td class="memTemplParams" colspan="2">template&lt;&gt; </td></tr>
<tr class="memitem:a0be4a57124877f215e0d37de9e538e81"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a0be4a57124877f215e0d37de9e538e81">convolution3d</a> (const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; uint8_t &gt; &amp;in, const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; uint8_t &gt; &amp;weights, const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; int32_t &gt; &amp;bias, <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; uint8_t &gt; &amp;out, int i_offset, int w_offset, int b_offset, int o_offset, int xi, int yi, int width_in, int height_in, int depth_in, int width_weights, int height_weights, int dilation_x, int dilation_y)</td></tr>
<tr class="separator:a0be4a57124877f215e0d37de9e538e81"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a74dc80546816db5f19029d6819a8bfee"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void convolution3d </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; TB &gt; &amp;&#160;</td>
          <td class="paramname"><em>bias</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>b_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>o_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>xi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>yi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>depth_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width_weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height_weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dilation_x</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dilation_y</em> = <code>1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_convolution3d_8h_source.xhtml#l00047">47</a> of file <a class="el" href="_convolution3d_8h_source.xhtml">Convolution3d.h</a>.</p>

<p>References <a class="el" href="validation_2_c_l_2_g_e_m_m_8cpp_source.xhtml#l00122">arm_compute::test::validation::b</a>, <a class="el" href="_simple_tensor_8h_source.xhtml#l00398">SimpleTensor&lt; T &gt;::data()</a>, <a class="el" href="_simple_tensor_8h_source.xhtml#l00306">SimpleTensor&lt; T &gt;::fixed_point_position()</a>, and <a class="el" href="_convolution3d_8h_source.xhtml#l00040">is_valid_pixel()</a>.</p>

<p>Referenced by <a class="el" href="validation_2reference_2_convolution_layer_8cpp_source.xhtml#l00050">arm_compute::test::validation::reference::convolution_layer_nchw()</a>, and <a class="el" href="reference_2_locally_connected_8cpp_source.xhtml#l00041">arm_compute::test::validation::reference::locally_connected()</a>.</p>
<div class="fragment"><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;{</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keyword">const</span> T *in_ptr  = in.data() + i_offset;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">const</span> T *w_ptr   = weights.data() + w_offset;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keyword">const</span> TB *b_ptr   = bias.data() + b_offset;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    T        *out_ptr = out.data() + o_offset;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> half_width_weights_start  = width_weights / 2;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> half_width_weights_end    = ((width_weights % 2) == 0) ? (half_width_weights_start - 1) : half_width_weights_start;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> half_height_weights_start = height_weights / 2;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> half_height_weights_end   = ((height_weights % 2) == 0) ? (half_height_weights_start - 1) : half_height_weights_start;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="comment">// Reset accumulator</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    T acc(0);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="comment">// Compute a 2D convolution for each IFM and accumulate the result</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> ifm = 0; ifm &lt; depth_in; ++ifm)</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    {</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <span class="comment">// Compute the offset for the input slice</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">int</span> offset_slice_in = xi + yi * width_in + ifm * width_in * height_in;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <span class="comment">// Compute 2D convolution</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> yk = -half_height_weights_start; yk &lt;= half_height_weights_end; ++yk)</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        {</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">int</span> xk = -half_width_weights_start; xk &lt;= half_width_weights_end; ++xk)</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            {</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                <span class="comment">// Check if the pixel is out-of-bound</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                <span class="keywordflow">if</span>(<a class="code" href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a03098570a566d97570169cb6d3106b6e">is_valid_pixel</a>(xi + xk * dilation_x, 0, width_in) &amp;&amp; <a class="code" href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a03098570a566d97570169cb6d3106b6e">is_valid_pixel</a>(yi + yk * dilation_y, 0, height_in))</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                {</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                    <span class="keyword">const</span> <span class="keywordtype">int</span> idx = xk + half_width_weights_start;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                    <span class="keyword">const</span> <span class="keywordtype">int</span> idy = yk + half_height_weights_start;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;                    <span class="keyword">const</span> T i_value = in_ptr[offset_slice_in + xk * dilation_x + yk * dilation_y * width_in];</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;                    <span class="keyword">const</span> T w_value = w_ptr[idx + idy * width_weights + ifm * width_weights * height_weights];</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;                    acc += i_value * w_value;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                }</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;            }</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        }</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="comment">// Accumulate the bias and store the result</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    *out_ptr = acc + (*b_ptr);</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;}</div><div class="ttc" id="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail_xhtml_a03098570a566d97570169cb6d3106b6e"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a03098570a566d97570169cb6d3106b6e">arm_compute::test::convolution_3d::detail::is_valid_pixel</a></div><div class="ttdeci">bool is_valid_pixel(int i, int min, int max)</div><div class="ttdef"><b>Definition:</b> <a href="_convolution3d_8h_source.xhtml#l00040">Convolution3d.h:40</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a0be4a57124877f215e0d37de9e538e81"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void arm_compute::test::convolution_3d::detail::convolution3d </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; uint8_t &gt; &amp;&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; uint8_t &gt; &amp;&#160;</td>
          <td class="paramname"><em>weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; int32_t &gt; &amp;&#160;</td>
          <td class="paramname"><em>bias</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor</a>&lt; uint8_t &gt; &amp;&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>b_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>o_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>xi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>yi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>depth_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width_weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height_weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dilation_x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dilation_y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_convolution3d_8h_source.xhtml#l00154">154</a> of file <a class="el" href="_convolution3d_8h_source.xhtml">Convolution3d.h</a>.</p>

<p>References <a class="el" href="_utils_quantized_asymm_8h_source.xhtml#l00044">arm_compute::test::validation::asymm_int_mult()</a>, <a class="el" href="_utils_quantized_asymm_8h_source.xhtml#l00036">arm_compute::test::validation::asymm_rounding_divide_by_pow2()</a>, <a class="el" href="namespacearm__compute_1_1quantization.xhtml#aa7bd9c3a3bcfe392c90d78e29429db26">arm_compute::quantization::calculate_quantized_multiplier_less_than_one()</a>, <a class="el" href="_simple_tensor_8h_source.xhtml#l00398">SimpleTensor&lt; T &gt;::data()</a>, <a class="el" href="_convolution3d_8h_source.xhtml#l00040">is_valid_pixel()</a>, <a class="el" href="arm__compute_2core_2_types_8h_source.xhtml#l00168">QuantizationInfo::offset</a>, <a class="el" href="_simple_tensor_8h_source.xhtml#l00312">SimpleTensor&lt; T &gt;::quantization_info()</a>, and <a class="el" href="arm__compute_2core_2_types_8h_source.xhtml#l00167">QuantizationInfo::scale</a>.</p>
<div class="fragment"><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;{</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keyword">const</span> uint8_t *in_ptr  = in.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#a0c52a8f0085b55d907af7210ef2069d0">data</a>() + i_offset;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keyword">const</span> uint8_t *w_ptr   = weights.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#a0c52a8f0085b55d907af7210ef2069d0">data</a>() + w_offset;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <span class="keyword">const</span> int32_t *b_ptr   = bias.data() + b_offset;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    uint8_t       *out_ptr = out.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#a0c52a8f0085b55d907af7210ef2069d0">data</a>() + o_offset;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span>   input_offset   = -in.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#ac74736e3863207232a23b7181c1d0f44">quantization_info</a>().<a class="code" href="structarm__compute_1_1_quantization_info.xhtml#aed7ea92f45bd273dde380a45ddced592">offset</a>;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">float</span> input_scale    = in.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#ac74736e3863207232a23b7181c1d0f44">quantization_info</a>().<a class="code" href="structarm__compute_1_1_quantization_info.xhtml#a1d28dec57cce925ad92342891bd71e7c">scale</a>;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span>   weights_offset = -weights.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#ac74736e3863207232a23b7181c1d0f44">quantization_info</a>().<a class="code" href="structarm__compute_1_1_quantization_info.xhtml#aed7ea92f45bd273dde380a45ddced592">offset</a>;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">float</span> weights_scale  = weights.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#ac74736e3863207232a23b7181c1d0f44">quantization_info</a>().<a class="code" href="structarm__compute_1_1_quantization_info.xhtml#a1d28dec57cce925ad92342891bd71e7c">scale</a>;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span>   output_offset  = out.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#ac74736e3863207232a23b7181c1d0f44">quantization_info</a>().<a class="code" href="structarm__compute_1_1_quantization_info.xhtml#aed7ea92f45bd273dde380a45ddced592">offset</a>;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">float</span> output_scale   = out.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#ac74736e3863207232a23b7181c1d0f44">quantization_info</a>().<a class="code" href="structarm__compute_1_1_quantization_info.xhtml#a1d28dec57cce925ad92342891bd71e7c">scale</a>;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordtype">int</span>         output_multiplier = 0;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keywordtype">int</span>         output_shift      = 0;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">float</span> multiplier        = input_scale * weights_scale / output_scale;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <a class="code" href="namespacearm__compute_1_1quantization.xhtml#aa7bd9c3a3bcfe392c90d78e29429db26">arm_compute::quantization::calculate_quantized_multiplier_less_than_one</a>(multiplier, &amp;output_multiplier, &amp;output_shift);</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> half_width_weights_start  = width_weights / 2;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> half_width_weights_end    = ((width_weights % 2) == 0) ? (half_width_weights_start - 1) : half_width_weights_start;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> half_height_weights_start = height_weights / 2;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> half_height_weights_end   = ((height_weights % 2) == 0) ? (half_height_weights_start - 1) : half_height_weights_start;</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="comment">// Reset accumulator</span></div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    int32_t acc(0);</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="comment">// Compute a 2D convolution for each IFM and accumulate the result</span></div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> ifm = 0; ifm &lt; depth_in; ++ifm)</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    {</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        <span class="comment">// Compute the offset for the input slice</span></div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">int</span> offset_slice_in = xi + yi * width_in + ifm * width_in * height_in;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        <span class="comment">// Compute 2D convolution</span></div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keywordflow">for</span>(<span class="keywordtype">int</span> yk = -half_height_weights_start; yk &lt;= half_height_weights_end; ++yk)</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        {</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;            <span class="keywordflow">for</span>(<span class="keywordtype">int</span> xk = -half_width_weights_start; xk &lt;= half_width_weights_end; ++xk)</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;            {</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;                <span class="comment">// Check if the pixel is out-of-bound</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;                <span class="keywordflow">if</span>(<a class="code" href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a03098570a566d97570169cb6d3106b6e">is_valid_pixel</a>(xi + xk * dilation_x, 0, width_in) &amp;&amp; <a class="code" href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a03098570a566d97570169cb6d3106b6e">is_valid_pixel</a>(yi + yk * dilation_y, 0, height_in))</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;                {</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;                    <span class="keyword">const</span> <span class="keywordtype">int</span> idx = xk + half_width_weights_start;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;                    <span class="keyword">const</span> <span class="keywordtype">int</span> idy = yk + half_height_weights_start;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;                    <span class="keyword">const</span> uint8_t i_value = in_ptr[offset_slice_in + xk * dilation_x + yk * dilation_y * width_in];</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;                    <span class="keyword">const</span> uint8_t w_value = w_ptr[idx + idy * width_weights + ifm * width_weights * height_weights];</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;                    acc += (i_value + input_offset) * (w_value + weights_offset);</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;                }</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;            }</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        }</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    }</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="comment">// Accumulate the bias</span></div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    acc += (*b_ptr);</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    acc = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5bab95cbeb5c6bf05049df7afd32d823">validation::asymm_rounding_divide_by_pow2</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#aea27abcd3d58d627282320dfdd213596">validation::asymm_int_mult</a>(acc, output_multiplier), output_shift);</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    acc += output_offset;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    acc = utility::clamp&lt;int32_t&gt;(acc, 0, 255);</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    <span class="comment">// Store the result</span></div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    *out_ptr = acc;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;}</div><div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a5bab95cbeb5c6bf05049df7afd32d823"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a5bab95cbeb5c6bf05049df7afd32d823">arm_compute::test::validation::asymm_rounding_divide_by_pow2</a></div><div class="ttdeci">int32_t asymm_rounding_divide_by_pow2(int32_t x, int exponent)</div><div class="ttdoc">Rounded to nearest division by a power-of-two. </div><div class="ttdef"><b>Definition:</b> <a href="_utils_quantized_asymm_8h_source.xhtml#l00036">UtilsQuantizedAsymm.h:36</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1quantization_xhtml_aa7bd9c3a3bcfe392c90d78e29429db26"><div class="ttname"><a href="namespacearm__compute_1_1quantization.xhtml#aa7bd9c3a3bcfe392c90d78e29429db26">arm_compute::quantization::calculate_quantized_multiplier_less_than_one</a></div><div class="ttdeci">arm_compute::Status calculate_quantized_multiplier_less_than_one(double multiplier, int *quant_multiplier, int *right_shift)</div><div class="ttdoc">Calculate quantized representation of multiplier with value less than one. </div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail_xhtml_a03098570a566d97570169cb6d3106b6e"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml#a03098570a566d97570169cb6d3106b6e">arm_compute::test::convolution_3d::detail::is_valid_pixel</a></div><div class="ttdeci">bool is_valid_pixel(int i, int min, int max)</div><div class="ttdef"><b>Definition:</b> <a href="_convolution3d_8h_source.xhtml#l00040">Convolution3d.h:40</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_aea27abcd3d58d627282320dfdd213596"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#aea27abcd3d58d627282320dfdd213596">arm_compute::test::validation::asymm_int_mult</a></div><div class="ttdeci">int32_t asymm_int_mult(int32_t a, int32_t b)</div><div class="ttdoc">Multiplication of two integers. </div><div class="ttdef"><b>Definition:</b> <a href="_utils_quantized_asymm_8h_source.xhtml#l00044">UtilsQuantizedAsymm.h:44</a></div></div>
<div class="ttc" id="structarm__compute_1_1_quantization_info_xhtml_a1d28dec57cce925ad92342891bd71e7c"><div class="ttname"><a href="structarm__compute_1_1_quantization_info.xhtml#a1d28dec57cce925ad92342891bd71e7c">arm_compute::QuantizationInfo::scale</a></div><div class="ttdeci">float scale</div><div class="ttdoc">scale </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_types_8h_source.xhtml#l00167">Types.h:167</a></div></div>
<div class="ttc" id="classarm__compute_1_1test_1_1_simple_tensor_xhtml_a0c52a8f0085b55d907af7210ef2069d0"><div class="ttname"><a href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#a0c52a8f0085b55d907af7210ef2069d0">arm_compute::test::SimpleTensor::data</a></div><div class="ttdeci">const T * data() const </div><div class="ttdoc">Constant pointer to the underlying buffer. </div><div class="ttdef"><b>Definition:</b> <a href="_simple_tensor_8h_source.xhtml#l00398">SimpleTensor.h:398</a></div></div>
<div class="ttc" id="classarm__compute_1_1test_1_1_simple_tensor_xhtml_ac74736e3863207232a23b7181c1d0f44"><div class="ttname"><a href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#ac74736e3863207232a23b7181c1d0f44">arm_compute::test::SimpleTensor::quantization_info</a></div><div class="ttdeci">QuantizationInfo quantization_info() const override</div><div class="ttdoc">Quantization info in case of asymmetric quantized type. </div><div class="ttdef"><b>Definition:</b> <a href="_simple_tensor_8h_source.xhtml#l00312">SimpleTensor.h:312</a></div></div>
<div class="ttc" id="structarm__compute_1_1_quantization_info_xhtml_aed7ea92f45bd273dde380a45ddced592"><div class="ttname"><a href="structarm__compute_1_1_quantization_info.xhtml#aed7ea92f45bd273dde380a45ddced592">arm_compute::QuantizationInfo::offset</a></div><div class="ttdeci">int offset</div><div class="ttdoc">offset </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_types_8h_source.xhtml#l00168">Types.h:168</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a03098570a566d97570169cb6d3106b6e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool arm_compute::test::convolution_3d::detail::is_valid_pixel </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_convolution3d_8h_source.xhtml#l00040">40</a> of file <a class="el" href="_convolution3d_8h_source.xhtml">Convolution3d.h</a>.</p>

<p>Referenced by <a class="el" href="_convolution3d_8h_source.xhtml#l00047">convolution3d()</a>.</p>
<div class="fragment"><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;{</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordflow">return</span> (i &gt;= <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">min</a> &amp;&amp; i &lt; <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">max</a>);</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;}</div><div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_aabcf39e3917f842dbc5fbb0d802f24d5"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">arm_compute::test::fixed_point_arithmetic::detail::min</a></div><div class="ttdeci">fixed_point&lt; T &gt; min(fixed_point&lt; T &gt; x, fixed_point&lt; T &gt; y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00897">FixedPoint.h:897</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_ad91bb73431b4de1f4946ed949d444849"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">arm_compute::test::fixed_point_arithmetic::detail::max</a></div><div class="ttdeci">fixed_point&lt; T &gt; max(fixed_point&lt; T &gt; x, fixed_point&lt; T &gt; y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00902">FixedPoint.h:902</a></div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test.xhtml">test</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test_1_1convolution__3d.xhtml">convolution_3d</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test_1_1convolution__3d_1_1detail.xhtml">detail</a></li>
    <li class="footer">Generated on Wed May 23 2018 11:36:44 for Compute Library by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
